package org.pupil.socket.compress;

import org.pupil.common.constants.Compression;
import org.pupil.spi.ExtensionLoader;

import java.io.IOException;

/**
 * @Description: 压缩工厂
 * @Author: pupil
 * @Date: 2024/07/24 下午 5:16
 */
public class CompressFactory {

    public static Compress get(Compression compression) {
        return ExtensionLoader.getInstance().get(compression.name);
    }

    public static Compress get(String name) {
        return ExtensionLoader.getInstance().get(name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(Compress.class);
    }
}
